/**
 *  离线操作Api
 * Created by wmm on 2018/11/30.
 */
import { Injectable } from '@angular/core';
import { HttpParams } from '@angular/common/http';

import { HttpUtil } from '../HttpUtil';

@Injectable()
export class OfflineDataApi {

  constructor(public httpUtil: HttpUtil) {
  }

  //获取属于该用户的项目计划地点信息
  getAppUserInfo() {
    const params = new HttpParams().set("token", localStorage.getItem("token"));
    return this.httpUtil.post("/api/offlineData/getAppUserInfo", params);
  }

  //获取公司的静态信息
  refreshCache() {
    const params = new HttpParams().set("token", localStorage.getItem("token"));
    return this.httpUtil.post("/api/offlineData/refreshCache", params);
  }

  //获取属于该用户的项目计划地点信息
  getAppProjectInfo() {
    const params = new HttpParams().set("token", localStorage.getItem("token"));
    return this.httpUtil.post("/api/offlineData/getAppProjectInfo", params);
  }

//获取属于该用户的项目计划地点信息
dataUpload(data:string) {
  const params = new HttpParams().set("token", localStorage.getItem("token")).set("data",data);
  return this.httpUtil.post("/api/offlineData/dataUpload", params);
}

}
